/*
 * StringShim.h
 *
 *  Created on: 2011-4-10
 *      Author: terry
 */

#ifndef STRINGSHIM_H_
#define STRINGSHIM_H_

#include <string>



class StringShim
{
public:
	StringShim();
	~StringShim();

	explicit StringShim(const char* ansiText);
	explicit StringShim(const wchar_t* wideText);
	explicit StringShim(const std::string& ansiText);
	explicit StringShim(const std::wstring& wideText);


	const wchar_t* toUnicode();
	const char* toAnsi();

	operator const wchar_t* ();

	operator const char* ();

	size_t copyTo(char* buffer, size_t length);

private:

	StringShim(const StringShim& shim);
	const StringShim& operator = (const StringShim& shim);

	void cleanup();

private:
	const char* m_ansiText;
	const wchar_t*	m_wideText;

	char*	m_ansiBuffer;
	wchar_t*	m_wideBuffer;

};

#endif /* STRINGSHIM_H_ */
